Source code for cppalliance.org, The C++ Alliance’s public-facing site. It is a classic Jekyll 3.8 project that publishes a fully static site through GitHub Pages.
bundle install
bundle exec jekyll serve --livereload- Install Ruby dependencies via Bundler.
- Iterate locally with
bundle exec jekyll serve --livereload; it compiles Sass, renders Markdown/HTML, and writes to_site/. - Edit content in
_posts/,people/, and page files; adjust styling inside_sass; place supporting media in the relevant asset directories. - Commit only source files.
_site/is build output and should remain untracked.
- Name files
YYYY-MM-DD-title.mdand place them in_posts/. - Use front matter similar to (or use other posts as templates):
--- layout: post nav-class: dark categories: company, vinnie # include the author’s id title: Something Worth Reading author-id: vinnie # maps to people/vinnie.html hero-image: 2024-01-01-title.png # optional; stored under images/posts/ large-image: /images/social-card.png # optional Twitter card override summary: Optional 160-character blurb for social cards ---
- Provide
author-nameif there is no matchingpeople/<id>.html. Otherwise the layout resolves the display name automatically. - Store hero images under
images/posts/; they appear in both the post header and the News index when present. _layouts/post.htmlcompares the fullcategoriesarray when building the “All posts by this author” list. Keep author ids consistent and avoid shuffling them between posts, or the archive may appear empty.- When a post has many sections, drop
{% include post-toc.md title="Contents" %}just below the intro. The include emits Kramdown’s{:toc}macro so the list stays synchronized with every heading automatically; omit thetitleparam to fall back to “Table of Contents.” - Write the body in Markdown/HTML, preview with
bundle exec jekyll serve --livereload, and confirm the post surfaces on/newsand the author’s bio page. The legacy wiki guide still applies, but this README is the canonical reference.
_config.ymldefines site metadata (title, description, contact email, social handles), Markdown settings (Kramdown + GFM), pagination defaults, Atom feed limits, Twitter card fallback, and plugin configuration (jekyll-feed,jekyll-sitemap,jekyll-email-protect,jekyll-seo-tag,jekyll-paginate).Gemfilepins Jekyll~> 3.8.3, Minima~> 2.0, and the plugin bundle. Always run commands viabundle execso these locked versions are honored._layouts/default.htmlsupplies the HTML skeleton: Google Fonts, compiled CSS, SEO tags, navigation, footer, analytics (Plausible + Google Analytics), Atom feed discovery, and conditional Prism assets for posts._site/contains the generated output—never hand-edit it.CNAMEkeeps the Pages deployment bound tocppalliance.org.Project Operation Guide.adocdocuments high-level operational practices (onboarding, hiring models) and should be updated alongside code conventions when relevant.
index.htmlcomposes Mission, Activities, Sponsors, Team, FAQ, News, and Contact sections. The IDs exposed there (#mission,#team, etc.) must stay aligned with the nav links inside_layouts/default.html.- Long-form subpages include
news/index.html(paginate_postswith optional hero art),slack/index.html(community FAQ + acceptable-use policy), andproposals.html(funding-request guidance). _posts/*.mdhouse dated blog/news entries withlayout: post. Each post must include the author’s id incategoriesso it flows into team pages.people/*.htmldefine team bios via front matter (member-name,position,id, contact links). Portraits live atimages/people/<id>.jpgand are consumed by theteamlayout.- Static assets such as PDFs, videos, SVG illustrations, and hero artwork sit directly under
/pdf,/videos,/images, etc., and are linked from the relevant pages.
_layouts/post.htmlrenders individual posts, handles hero images, resolvesauthor-idinto a display name, loads Prism assets, and generates an “All posts by this author” list._layouts/team.htmlrenders member pages with the photo, title, social icon bar (_includes/team-bio.html), bio body, and the_includes/team-blog.htmlfeed filtered bysite.categories[page.id]._includes/top-title.htmlsupplies the home hero;contact.htmlrenders the “Connect” social grid;favicon.htmlinjects favicon link tags;paginator.htmldrives numbered pagination;team-bio.htmloutputs gold icons for each contact field.
page.nav-classtoggles nav styling (transparentfor the homepage hero,darkelsewhere). Always set it on new pages.- Social metadata falls back to
site.title_image. Posts can override viapage.imageorpage.large-image, and supplyingpage.summarytightens the Twitter description. - Nav links are hardcoded to the homepage anchors plus a few static pages. Keep section IDs and link targets synchronized to avoid dead anchors, especially on mobile.
- Plausible and Google Analytics scripts live exclusively in the default layout; no other template should add tracking snippets.
- Prism CSS/JS only load when
page.layout == 'post'. Reuse that layout (or the same condition) for any new syntax-highlighted content.
css/style.scssis the sole Sass entry point compiled by Jekyll intocss/style.css. It imports partials in this order:_sass/base: reset, tokens (config.scss), helper functions, typography, print styles._sass/modules: reusable components (cards, hero, navigation, layout grid, news list, Slack page, footer, social icons)._sass/pages: page-specific layers (homepage.scss,post.scss,team.scss).post_backup.scssis retained for reference but not imported.
css/prism.cssstyles syntax-highlighted blocks inside posts and is only loaded when the layout requests it.
js/main.jspowers the responsive nav drawer: toggles the hamburger, locks body scroll when the menu is open, closes the drawer on resize, and auto-hides after tapping any.nav-link-mobilebelow 1024px width.js/prism.jsis a vendored PrismJS 1.20.0 build with C/C++ grammars and theline-numbers,toolbar, andcopy-to-clipboardplugins. The default layout loads it for post pages only.
news/index.htmlusespaginator.posts(5 per page by default) and falls back tosite.postsif pagination is disabled. Snippets come frompost.content | strip_html | truncate: 500.slack/index.htmlis the authoritative source for invite links, FAQs, acceptable-use policy, and resource links. Its markup ties directly into_sass/modules/slack.scss.proposals.htmldescribes the criteria for funding proposals and emailslouis@cppalliance.org(encoded via| encode_email).people/*.htmlrely onpage.idmatching the filename and portrait asset. The same id doubles as the key insite.categories.index.htmlhardcodes the team card grid, pulls in the hero include, and reusescontact.html. Updating the team requires changes here plus the correspondingpeople/*.htmlentries and portrait assets.
- Static media lives directly under
/images,/videos,/fonts,/pdf, and/news. Social icons live inimages/icons/*.svgand are referenced in both the nav and contact sections. - Blog hero art should live in
images/posts/. People portraits must sit underimages/people/using the person’sid. - Favicons (
favicon-*.png,safari-pinned-tab.svg,android-chrome-*.png, etc.) andCNAMEsupport the custom domain—update only when branding changes.
- Keep navigation anchor IDs synchronized with the hardcoded links in
_layouts/default.html. If you rename#mission, update both the section ID and every nav link pointing to it. _includes/team-blog.htmlexpectssite.categories[page.id]to exist. If a member page renders no posts, double-check the spelling of the author id in every post’scategories._includes/paginator.htmlreferencessite.data.ui-text[site.locale]for labeling. Leaving these values unset falls back to “Previous/Next,” so only touch them if localization is intentional.- Encode email addresses with
| encode_emailfor consistency (contact.html,proposals.html, people pages). - When creating new highlighted pages, either reuse
layout: postor replicate its Prism loading behavior. - Never modify files under
_site/; rebuild instead.