pidgin/nest

Update to hugo-theme-learn 2.5.0

18 months ago, Elliott Sales de Andrade
50afdb25d25a
Update to hugo-theme-learn 2.5.0

The latest version improves compatibility with latest Hugo and adds several enhancements. This enables us to drop most of our vendored copies of the theme files.

* Mermaid is now a theme option, so we don't need to overlay a copy of the partial with it removed.
* Custom CSS has a theme option to load it, so we don't need to add it to `custom-header.html`.
* It now uses the [recommended colour style variant customization](https://learn.netlify.app/en/basics/style-customization/#yours-variant) instead of copying the theme's CSS. Most of the sidebar seemed unchanged from the default, but I copied them anyway to prevent them changing.
* Dropping the copy of the theme CSS means moving our customized fixed-max-width style on the body to the custom CSS.
* I moved the footer into `custom-footer.html` so that most partials would not need to be copied; this does mean it's no longer a bubble that's the width of the content, but I always found that weird anyway. Some new CSS is necessary to make it centred properly.
* I found many of the partials and the JavaScript were functionally the same as the original theme's copy, so I removed them.

Testing Done:
Opened up a few pages and saw things were roughly equivalent, except the footer as noted above.

The only regression I believe is that the ToC is no longer automatically added on 'long' pages. However, it's still there on hover of the ToC icon.

Reviewed at https://reviews.imfreedom.org/r/1933/
#####################################################################
# setup up our node environment
#####################################################################
FROM docker.io/node:14-buster-slim as node-update-date
WORKDIR /nest/
COPY package-lock.json package.json ./
RUN apt-get update && \
apt-get install -y mercurial && \
apt-get clean && \
npm ci --production && \
npm cache clean --force
COPY .hg /nest/.hg
COPY hugo /nest/hugo
COPY tools /nest/tools
RUN node tools/update-lastmod.js
#####################################################################
# run the hugo build
#####################################################################
FROM docker.io/debian:bullseye as hugo-build
RUN set -ex && \
apt-get update && \
apt-get install -y golang hugo && \
apt-get clean && \
rm -rf /var/lib/apt/lists
ARG BUILD_NAME
ARG BUILD_DATE
ARG COMMIT
COPY --from=node-update-date /nest/hugo /nest/hugo
RUN hugo -s /nest/hugo -d /nest/public && \
cp /nest/public/post/index.xml /nest/public/rss.xml
#####################################################################
# setup up our node environment
#####################################################################
FROM docker.io/node:14-buster-slim as node-build
WORKDIR /nest/
COPY package-lock.json package.json ./
RUN npm ci --production && \
npm cache clean --force
COPY tools ./tools
COPY --from=hugo-build /nest/public public
RUN node tools/pre-prod.js
#####################################################################
# finally package everything up with rwgrim/goserve
#####################################################################
FROM docker.io/rwgrim/goserve
ENV GOSERVE_404_PAGE="/html/404.html"
COPY --from=node-build /nest/public /html/
EXPOSE 3000/tcp