Build blog and community with hugo#3558
Conversation
|
Love the CSS!! Also tips you off that you are about to experience a different format to the one you are currently on. Heads up, got this error: Going to install postcss and try again |
|
oh yeah, you do indeed need postcss for the hugo build, and there's another library too I think it needs I forgot to document, |
|
It looks like this build off of the existing website repo, so none of the processes for posting to the blog or editing community will change? Also, still getting this error after running |
correct, the build for those parts is essentially unmodified (just being driven from docs rather than other way round), so all the author workflows for docs/community should stay the same, I think |
|
|
|
There will need to be a clean up story written to ensure that folks cannot escape into the old site, but for now, this is absolutely sufficiently de-risked. Good work @julz! |
|
/lgtm |
|
Using Doesn't work for me |
|
They need to be local for me to work Then it works. ❯ cat package.json
{
"dependencies": {
"autoprefixer": "^10.2.5",
"postcss": "^8.2.15",
"postcss-cli": "^8.3.1"
}
} |
csantanapr
left a comment
There was a problem hiding this comment.
Add package.json and package-lock.json
{
"dependencies": {
"autoprefixer": "^10.2.5",
"postcss": "^8.2.15",
"postcss-cli": "^8.3.1"
}
}
this way user can just npm install at the root before running the script
|
add |
|
|
||
| if [ "$1" = "serve" ]; then | ||
| pushd site | ||
| http-server |
There was a problem hiding this comment.
You think is better to use python3 -m http.server 8000 ?
There was a problem hiding this comment.
Dunno, I just picked the first thing I found that worked 😅 we need npm for autoprefixer and postcss anyway tho so doesn't seem any big reason to switch 🤷♂️. Might be able to make it a one liner with "npx run http-server" tho 🤔
|
I'm done with the review, is works great. I would say lets add the package.json and package-lock.json, and the .gitignore for |
|
/hold |
|
ok, copied the package.json over from website and deleted the libraries we don't use. Also added temp and node_modules to gitignore and changed the @csantanapr ptal! |
|
works like a charm |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: csantanapr The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest |
* Build blog and community with hugo * Use http-server instead of serve * Add package.json and ignore temp
* Build blog and community with hugo * Use http-server instead of serve * Add package.json and ignore temp
Fixes #3539.
Fixes #3541.
Builds the blog and community tabs with hugo.
Also added a little CSS to visually distinguish these links.
This works by cloning the website and community repos locally, copying blog and community in to the right places (same trick website uses in https://github.com/knative/website/blob/main/scripts/processsourcefiles.sh#L107), and then building those pieces using hugo in to the same site dir as mkdocs builds the docs.
Running:
mkdocs servepreviews just the main site (with live reloading previews)./hack/build-with-blog.shbuilds to/site/and is what we should run in the netlify build/github action../hack/build-with-blog.sh servebuilds to/site/and starts a local preview server with blog/community included (but no live reloads, sorry!).npm install -g http-serverfirst.Follow on work: allow community/website to be checked out as sibling directories/cached to avoid rerunning the git clone / allow local testing of changes to these repositories.
Known issue: the library Im using to do the local preview (npm install -g serve) doesn't cope with URLs that have dots in them, likehttp://localhost:5000/blog/2021/01/15/version-v0.20-release/, this is just a local preview issue which can be solved by using some other tool to preview the builtsite/directory, but I think we can solve that separately... Fixed! Using
http-serverinstead./assign @omerbensaadon @csantanapr