Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new Makefile, copy static files from other directory #347

Merged
merged 1 commit into from May 21, 2019

Conversation

akoehn
Copy link
Member

@akoehn akoehn commented May 16, 2019

Introduces a basic Makefile, as discussed in #316.

Files previously residing in hugo/ are now kept in hugo-src and copied
as part of the build process, so that rm -rf hugo cleans everything.

The Makefile consists of a set of phony targets, each building a part
of the site.

Relevant targets:

  • site: creates the site
  • all: cleans output, checks validity of XML and creates the site
  • serve: starts a web server on localhost:8000 to browse the site
  • upload: rsyncs the site to the aclweb webserver

This means: make all serve will rebuild the site from scratch and start a webserver,
make all upload will rebuild the site and upload it to the official web server.

Comments welcome!

@mbollmann
Copy link
Member

Thanks for the PR! I can see that this is already quite handy for only performing specific steps of the build chain, without having to know or look up the exact commands to achieve them.

Some comments:

  1. Your commit duplicates the files in hugo-src/. I believe when they're moved (i.e., added in hugo-src and deleted in hugo) in one commit, it's possible to keep tracking the change history of the files (with git blame). I'm not sure what happens if this is stretched out over several commits. It would be nice to make sure that history doesn't get lost, if possible.

  2. Before we decide to merge this, we should also make sure to update the documentation, and probably the CI build script as well. (Just leaving this here as a reminder.)

  3. Just curious: Do you think it's possible to replace some of the phony targets with concrete ones? Or is that infeasible due to the huge number of (partly dynamically generated) files?

@akoehn
Copy link
Member Author

akoehn commented May 17, 2019

Re 1.: That is an error, I was obviously too tied yesterday; I thought I did a git mv.

Yes, please consider this a work in progress. I just wanted early feedback.

That would certainly be possible, the dependencies can be provided by an external program. This would however mean that the python scripts can be instructed to only (re-)generate a subset of the data. I had a short look at that and we could discuss it later.

@mbollmann
Copy link
Member

An addendum: I tried the python -m http.server command to browse the generated site, and it didn't really work, since the way Hugo is configured right now the site expects to live under /anthology on the server...

@akoehn akoehn mentioned this pull request May 18, 2019
7 tasks
@mjpost
Copy link
Member

mjpost commented May 20, 2019

Thanks for this!

It's a minor aesthetic detail that I could easily adapt to, but I dislike having a hugo-src directory instead of just hugo. Would it be difficult to keep the current structure and generate to hugo-build or build/hugo or something like that? (It would also make the PR smaller.)

Files previously residing in hugo/ are now copied
as part of the build process, the website is built into build/.
This way, rm -rf build cleans everything.

The website to be published is generated into the directory
build/anthology by default, reflecting the directory name used on the
upstream server.  This directory can be configured using
make ANTHOLOGYDIR=someotherdir.

The Makefile consists of a set of phony targets, each building a part
of the site.

Relevant targets:
 - site: creates the site
 - all: cleans output, checks validity of XML and creates the site
 - serve: starts a web server on localhost:8000 to browse the site
 - upload: rsyncs the site to the aclweb webserver
@akoehn
Copy link
Member Author

akoehn commented May 21, 2019

I have updated the pull request:

  • files in hugo are still in that place (although hugo does not seem to be a fitting name anymore)
  • the site is built into the build directory.
  • READMEs updated
  • travis.yml updated/
  • make serve works

@akoehn
Copy link
Member Author

akoehn commented May 21, 2019

Oh, I forgot to mention, as I stated this PR to be preliminary before: Please have a look and if it looks good to you (@mjpost, @mbollmann), I'll merge it.

@mjpost
Copy link
Member

mjpost commented May 21, 2019

This is great. I had to make one small change since the sed -i invocation is not platform-neutral, sadly, and broke on OS X.

(I think you saw I had you added as a contributor. Feel free to use local branches now, which make updating easier)

@mjpost mjpost merged commit e2eb08b into acl-org:master May 21, 2019
@mjpost
Copy link
Member

mjpost commented May 21, 2019

I merged it locally, since I couldn't update your branch, but also Github wouldn't let me create a new PR since it tied the branch I created to your remote PR, somehow.

Sorry to deny you the pleasure of closure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants