aboutsummaryrefslogtreecommitdiff
path: root/www/publish.sh
Commit message (Collapse)AuthorAgeFilesLines
* Speed up website buildMichael Reed2017-07-151-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that we only need bare HTML files for .md files in news, yet publish.sh creates them unconditionally. That is, we spend a lot of time building bare HTML files that we never use. This commit makes it so that bare HTML files are only generated for news files, which speeds up the website build significantly: $ /home/michael/benchmark.sh speed-up-build master Already on 'speed-up-build' NOW TESTING ON speed-up-build 0m08.24s real 0m08.53s user 0m05.57s system 0m08.21s real 0m08.39s user 0m05.58s system 0m08.26s real 0m08.23s user 0m05.70s system 0m08.26s real 0m08.27s user 0m05.91s system 0m08.24s real 0m08.36s user 0m05.63s system 0m08.28s real 0m08.40s user 0m05.67s system 0m08.29s real 0m08.21s user 0m05.83s system 0m08.23s real 0m08.12s user 0m05.80s system 0m08.32s real 0m08.32s user 0m05.75s system 0m08.30s real 0m08.40s user 0m05.61s system Switched to branch 'master' Your branch is ahead of 'origin/master' by 33 commits. NOW TESTING ON master 0m12.98s real 0m15.07s user 0m07.18s system 0m12.93s real 0m14.57s user 0m07.69s system 0m12.98s real 0m15.06s user 0m07.46s system 0m12.98s real 0m14.75s user 0m07.67s system 0m12.94s real 0m15.10s user 0m07.22s system 0m12.94s real 0m14.95s user 0m07.22s system 0m12.98s real 0m14.57s user 0m08.02s system 0m12.96s real 0m14.84s user 0m07.41s system 0m12.96s real 0m14.99s user 0m07.49s system 0m13.06s real 0m14.91s user 0m07.54s system And here's the script in question, benchmark.sh: #!/bin/sh set -u set -e # usage: runit branch runit() { git checkout "$1" echo echo NOW TESTING ON "$1" echo for i in `jot 10`; do make clean >/dev/null; time make -j2 >/dev/null; done } make clean >/dev/null for branch in "$@" do runit "$branch" done
* www/publish.sh: Fix quoting bugMichael Reed2017-07-151-1/+4
| | | | | | | | | | | | | | | | | | | When running "bash -x publish.sh index.md", the following happens: + pandoc --smart /tmp/libreboot_www.Xne7SYgf4e -s --css /global.css '--css /headercenter.css' --template template.html --metadata return= pandoc: unrecognized option `--css /headercenter.css' Try pandoc --help for more information. This is because the OPTS variable is being quoted, which causes its value of "-css /headercenter.css" to not be split on word boundaries, that is, spaces. Because pandoc has a "--css" option, but not a "--css /headercenter.css" option, pandoc expectedly complains that said option does not exist. To fix this we just unquote OPTS, and add a shellcheck ignore directive so this won't be reintroduced in the future. Caused by: a8d89665de6da20a8793886e03f153e922f6e519.
* www/publish.sh: Clean up shellcheck warningsMichael Reed2017-07-131-4/+4
| | | | | | | All of the warnings were of type SC2086 [1]: Double quote to prevent globbing and word splitting. [1]: https://github.com/koalaman/shellcheck/wiki/Sc2086
* www/publish.sh: Fix conditionals for file matchingMichael Reed2017-07-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | Before the Makefile, publish.sh was executed on markdown source files using find(1), which happened like this: ./publish.sh ./index.md Now that we have a Makefile, this happens instead: ./publish.sh index.md Note that the file argument "index.md" in the first and second case both refer to the same file, yet they are different strings. This is important because publish.sh gives index.md (among other files) special treatment, and it does this by string comparison. Unfortunately, only the argument in the first case ("./index.md") will cause publish.sh to give special treatment, while the argumnent in the second case ("index.md") will not. To fix this, make it so that both "./index.md" and "index.md" trigger publish.sh's special handling. This commit also fixes the same issue for "docs/fdl-1.3.md" and "conduct.md".
* Build website incrementally (and faster if you have the CPU cores)Michael Reed2017-07-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | This is done by replacing www/generate.sh with a Makefile. Benefits: - Makes builds incremental, meaning that only the minimum number of markdown files will be converted to HTML during a build. The previous scheme always generated a new HTML file for every markdown file, which is a big waste of time if only 1 or 2 markdown files have been changed. - Allows for much faster builds through concurrent jobs (e.g., via "make -j4"). On my 4-core machine, my average build time for the website with generate.sh was just over 26 seconds; with "make -j4", it was 13 seconds. - Avoids portability issues with find(1) in generate.sh, which I was encountering on OpenBSD. A note on portability: unlike GNU Make, OpenBSD's Make does not have the "$(shell [commands])" construct, so we don't use that. Instead we use "!= [commands]", which is supported by both.
* www/publish.sh: Make safe to run multiple instances concurrentlyMichael Reed2017-07-091-9/+14
| | | | | | Instead of always using the same file (temp.md), use a unique temporary file so that multiple instances of publish.sh do not clobber each other's work.
* docs/publish.sh: Fix sed(1) invocation on OpenBSDMichael Reed2017-07-051-5/+5
| | | | | | | | | | | | | | | | | | | On OpenBSD, publish.sh errors out at the following call to sed(1) (from "bash -x publish.sh"): + sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g' sed: 1: "temp.md": undefined label 'emp.md' It seems that "temp.md" is being parsed by sed as a sed command, not as a named file. This is likely due to OpenBSD's strict usage requirements for sed: usage: sed [-aEnru] [-i[extension]] command [file ...] sed [-aEnru] [-e command] [-f command_file] [-i[extension]] [file ...] As shown above, the sed command must always come before any named files. This commit does that, which fixes publish.sh with OpenBSD's sed. This is also tested and working with GNU sed v4.2.2
* Replaced '#!/bin/bash' w/ '#!/usr/bin/env bash'Andrew Robbins2017-06-231-1/+1
| | | | | This is mainly useful for being able to run these scripts on BSDs. And for users who use a Bash not installed to /bin.
* Swapped out 'echo' calls w/ 'printf ...'Andrew Robbins2017-06-231-4/+4
| | | | Continuation of pull request #217 re: printf usage.
* Fixed printf calls & replaced 'echo' w/ printf.Andrew Robbins2017-06-231-1/+1
| | | | | | | | | All printf calls should now be properly formatted; prior, the format specifier string was erroneously used for both the format specifiers and the string to be printed. 'env' is now used to locate the printf binary so as to avoid potentially using a shell builtin. Lastly, all calls to 'echo' within the new build system have been replaced with printf for consistency/portability purposes.
* fix links on andrew's news entry, with alyssa's permissionLeah Rowe2017-06-051-0/+4
| | | | | pull request not needed. alyssa gave me permission via email, to push this directly to master
* Add edit link to all pages, linking to instructions for sending patchesLeah Rowe2017-05-301-2/+2
| | | | | | | This is necessary, so that people know how to modify the website and send improvements, like they do on wiki sites. Although Libreboot is git-hosted, having this link helps. It goes to a section added to the Git page, instructing users how to edit the website and documentation.
* further tidy suppliers.md: small headers, back to home link at bottom of pageLeah Rowe2017-05-281-7/+15
|
* Footer separate fileAlyssa Rosenzweig2017-05-131-7/+1
|
* Intuitive header centerAlyssa Rosenzweig2017-05-131-1/+3
|
* Hide section linksAlyssa Rosenzweig2017-05-121-1/+1
| | | | | | Section links are still visible when CSS is not enabled. On browsers, headers need to be hovered for links. On screen-readers, they are hidden entirely.
* Fixed typo in sed command to generate section title anchors.Christopher Bero2017-05-121-1/+1
|
* Section title anchors for webpages.Christopher Bero2017-05-121-2/+2
|
* example of section hyperlinks, do not merge.Christopher Bero2017-05-121-0/+3
|
* Re-license all documentation under GNU Free Documentation License v1.3/higherLeah Rowe2017-04-301-6/+10
|
* Fix footer links on website (Alyssa gave me permission to merge it)Leah Rowe2017-04-281-1/+1
|
* website: Move link to Peers into the footer (tidy up the homepage)Leah Rowe2017-04-281-0/+1
|
* Tighten up footerAlyssa Rosenzweig2017-04-261-3/+3
|
* www/management: Introduce new democratic and collective leadership policyLeah Rowe2017-04-251-1/+2
|
* Footer section on webpages: Rename "Code of Conduct" to "Conduct Guidelines"Leah Rowe2017-04-091-1/+1
|
* Adopt the Contributor Covenant v1.4 as Libreboot's official Code of ConductLeah Rowe2017-04-091-1/+3
|
* Setup publish script for RSSAlyssa Rosenzweig2017-04-081-9/+8
|
* tidy up homepage. improve nav menu. move link to authors page into the footerLeah Rowe2017-04-081-1/+1
|
* website and publish.sh: do not link to index files, link to directories.Leah Rowe2017-04-071-2/+2
|
* change .html links to .md links, everywhereLeah Rowe2017-04-051-0/+1
|
* Center only the homepage header. Align:left for everything elseLeah Rowe2017-04-051-3/+10
|
* publish.sh: remove test cases; remove check on unbound variables (TODO: fix)Leah Rowe2017-04-051-4/+3
| | | | Alyssa, you need to make sure that variables are always bound.
* testingLeah Rowe2017-04-051-2/+4
|
* add error-checking to publish.shLeah Rowe2017-04-051-2/+5
|
* fix link to license.htmlLeah Rowe2017-04-051-1/+1
|
* License publishAlyssa Rosenzweig2017-04-041-1/+17
|
* Bad indexing with templatesAlyssa Rosenzweig2017-04-041-6/+10
|
* Remove some of the less relevant FAQ entriesAlyssa Rosenzweig2017-04-041-1/+1
|
* Misc www cleanupAlyssa Rosenzweig2017-04-041-5/+8
|
* Link to the correct fileAlyssa Rosenzweig2017-04-031-1/+1
|
* fix publishAlyssa Rosenzweig2017-04-031-12/+4
|
* Use a custom templateAlyssa Rosenzweig2017-04-031-2/+2
|
* temp readd backlinksAlyssa Rosenzweig2017-04-021-3/+3
|
* fix seoAlyssa Rosenzweig2017-04-021-3/+0
|
* avoid breaking things for nowAlyssa Rosenzweig2017-04-021-3/+3
|
* Open Letter to the Free Software CommunityAlyssa Rosenzweig2017-04-021-3/+7
|
* Don't eat 'amd'Alyssa Rosenzweig2017-03-271-1/+1
|
* Fixes to logo page -- I still don't like it, but heyAlyssa Rosenzweig2017-03-211-1/+1
|
* Logo information pageAlyssa Rosenzweig2017-03-211-1/+1
|
* add license if applicableAlyssa Rosenzweig2017-03-201-1/+6
|