Git Product home page Git Product logo

dannyis-jekyll's Introduction



Danny.is Jekyll

Netlify Status

Install and Run

brew install imagemagick netlify
bundle install

netlify dev

Values

  • Simple
  • Beautiful
  • Authenntic
  • Content-first

Site/User Goals

  • Danny
    • Express himself freely and without constraint.
    • Have fun. With writing, design and code.
    • Connect with people he can help, or who can help him.
  • Interested reader
    • Read Danny's words in peace.
    • (Perhaps) be notified when Danny writes some new words.
  • Person checking Danny out
    • Find out if Danny is the right person to help them.
    • Contact him.

Redesign Goals

  • I want a simpler, more technology-agnostic website.
  • I want to write on my own website, not on Medium.
  1. Represent myself more authentically.
  2. Simplify my own mental model for who I am and what I do, as expressed through this site.
  3. Make things more obvious and useful to readers.
  4. Put my writing at the front, and make it beautiful.
  5. Provide somewhere for folks to find out about my work, and how I might be able help them.

Engineering Principles

  1. As few dependencies as possible (both build-time and run-time).
  2. Use defaults wherever possible.
  3. Write as little code as possible.
  4. Do not over-abstract. Avoid fallbacks, polyfills and hacks.
  5. Bake accessibility in.

Tools

  • The code lives on Github.
  • Deployed to Netlify.
  • Quick access via Forestry.io.
  • Database lives on Airtable and is accessed via Netlify lambda functions

Documentation

This documentation is mainly for my own use. It;s too easy to forget the conventions if I don't touch this for a while.

Writing essays

Use Jekyll's _drafts folder. You can write in either markdown or HTML, though markdown is preferred. When a post is ready to publish, update the filename with the publication date and move it to _posts. No frontmatter is required, though it's recommended you always supply a title.

To keep posts looking nice, stick to the following rules:

  1. Always begin with a longish paragraph, and avoid formatting in the first line where possible.
  2. Always end with a summary paragraph.
  3. Wrap all acronyms in <abbr> tags - providing a title is optional.
  4. Always provide alt text for images.

Images

Images should be named in the form YYY-MM-DD-title.ext and added to _uploads. Do not use subfolders. There is a github app to optimize the images via PR.

The following layout classes are provided for use with images, though they can be used with any block content:

Tag Desscription
{:.full-bleed} The image will bleed out to the edges of the screen
{:.left-bleed} The image will bleed out to the left
{:.right-bleed} The image will bleed out to the right.
{:.border} The image will be rendered with a border and internal pading. Good for images with a background similar to the site background colour.

The bleed classes should always be applied to a paragraph wrapping the image, like this:

{:.full-bleed}
![Example](/uploads/example.png)

The bordr can be applied to either the wrapper or the element itself. To combine a bleed and border, apply the border to the image:

{:.full-bleed}
![Example](/uploads/example.png){:.border}

Code blocks

Prefer gists for longer code samples, and always specify a language when writing fenced code blocks.

Callouts

Callouts can be added like this

{:.callout}
This is a callout

Adding Externally hosted essays

Create a new markdown file in /posts with the publication date in the file name. Add three fields to the frontmatter: title, rediirect_to and platform.

title: Business Process and Tooling
redirect_to: 'https://medium.com/@dannysmith/business-process-tooling-56f1e3341d21'
platform: medium

The post will be rendered as normal in lists but will redirect to the URL provided. The platform field us used to style external links differently. Any single-word string is valid but medium, devto recieve special styling.

Adding new pages and redirects

Create a new page in _pages. Any pages in this folder will be mapped to the root of the site.

You can create redirects in the same way as for posts above. To redirect https://danny.is/google to https://google.com, greate a file named google.md in _pages with one line of frontmatter: redirect_to: https://google.com.

If you are creating a page for the site, prefer HTML over markdown in most cases. If we're creating a "fishing" page...

  1. Create fishing.html in _pages.
  2. Add a title and body-class: page-fishing to the frontmatter. The body-class will be applied as a class to the <body> element so we can style the page.
  3. Create a page-fishing.scss file in _sass and include it in main.scss.
  4. Write your page-specific styles nested in a .page-fishing selector.

If you apply a body-class of no-drop-cap to an essay, a drop cap won't be used. This is useful for essays with very short first paragraphs.

Danny Smith

dannyis-jekyll's People

Contributors

dannysmith avatar dependabot-preview[bot] avatar imgbotapp avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

dannyis-jekyll's Issues

Captions and Lightbox for images and videos

Images should support captions, and possibly some sort of lightbox. It might also be nice to arrange multiple images into a grid of sorts.

Likewise, videos and other embeds should behave nicely when embedded, and maybe include captions too.

We need to balance accessibility and good HTML with ease of writing/editing in markdown, though. So it might not be possible to do too much of this.

Styled code blocks

Generally, I should probably stick to using gists for this because of simplicity.

But I should try to style code blocks.

  • Syntax Highlightng
  • Nice theme
  • Line Numbers (on hover?)
  • Easy copy/paste

I also need to include whatever monospace font I use as a web-font for users that don't have it on their OS.

Style Links

  • Subtle underline on devices with hover, transitioning to coloured when active or hovered.
  • Nice custom outline when focussed via keyboard.
  • Subtle purple colour when visited. Maybe just the underline goes purple?
  • If possible, increase tap area for devices with a coarse pointer.
  • Test all colours for accessibility.

Share sheets for articles (and other pages)

Metadata so that when page URLs are shared, a nice summary is provided so LinkedIn/Facebook/Slack etc.

This should certainly include slightly tweaked basic details like title and summary.

It should also include a suitable image, which could be auto-generated as part of the Jekyll build process. This could be a screenshot or it could be a custom image rendered from the article title. Or a combination of both.

I might also consider injecting a pilcrow into the excerpt if it contains line breaks because it's nerdy.

I should also include the calculated reading time in this summary somehow.

Books Page

Generate a Books page which shows my recommended books. This shouldn't include all the books that I'm reading, but instead should list the books I recommend regularly, abut various topics. Basically, keep it simple and clean.

Responsive, lazy-loaded Images in articles

It would be good to have a build-time plugin that does the following:

  1. Finds all images in markdown.
  2. For large images, generates smaller versions with the same aspect ratio in the build folder and inserts an appropriate srcset attribute into the image tag so the lowe-res versions are used in smaller containers.
  3. Optimises all versions.
  4. Adds explicit dimensions to the image tag, based on the original image size.
  5. Adds a native lazy loading attribute.

This eleventy plugin does steps 4 and 5, as well as adding a data encoded low-res version and some javascript to swap it out when the user scrolls near to it.

This one does the rest.

See this video for more https://www.youtube.com/watch?v=4-d_SoCHeWE

Proper Styleguide

Styleguide should explain the core concepts behind the site, link to the articles in the series and include examples of every type of style in a sensible, readable way.

Should also include a colour palette (squares of the right colours) and a list of the special utility classes and how to use them when writing articles.

Writing page

  • Make it look pretty
  • Differentiate delicate, medium and local articles
  • Add link back to homepage
  • Add copyright notice

Write about page copy

Keep it simple...

  • Photo
  • Links to Twitter, youtube etc
  • Top-line description

Description

  • Use my CV as inspiration
  • Use Delocate's values as inspiration.

Used to be a software engineer.
Then a teacher.

See iA Writer

Replicate current site styles

  • Use true black for certain stuff
  • Fix the main nav so it looks as nice as the current site's
  • Fix the 404 page so it looks just as good.

Fix hack to replace markdown links with liquid tags

9f6d15d introduces a hack in _posts/2020-03-14-website-redesign-i.md which replaces all markdown links with a responsive image tag.

It uses simple REgEx to do so which is super hacky and horrible.

It also leads to bugs because it parses code inside fenced code blocks. Thus, any markdown image markup inside a code block will be replaced with a liquid tag.

Styling With Simplicity

  • "Being Redesigned in the open" Banner
  • Homepage (like current site but less colour)
  • Article list page - keep it very simple for now
  • Copyright note (include in all pages)
  • Home link on every article page
  • Very simple footer on article page - links to home/about etc.
  • Basic info and styling for about page

Change full-bleed article layout to use CSS Grid

This article demonstrates how to use CSS Grid to produce a centered column with the option for full-bleed or part-bleed images.

This approach would reduce the amount of CSS I need to achieve this, and also drastically simplify the mental model needed to understand how it all works.

Plus it's a modern approach which will help me to learn CSS grid.

Port old blog articles from v1 website

See the list of forwards on dannysmith/dannyis.

  • Port over images and markdown to Jekyll.
  • Set slugs to match historic slugs.
  • Mark articles as "old" somehow.
  • Set http://v1.danny.is/ to forward to current site with a perm redirect.
  • Wind down v1 instance on Heroku.
  • Archive v1 site on GH.

Better fallback stacks for fonts

The current fallback stack is simplistic:

``css
--font-copy: 'Literata', Georgia, 'Times New Roman', serif;
}


Once I have a stronger idea of the typefaces I'm using, I should try to find some common fallbacks that render more similarly to the web fonts I'm using so the font swap is less jarring.

I should also consider providing the regular version of the main font as a fallback when loading specialist versions. Eg.

```css
--font-caption: 'Literata Caption', 'Literata', Gerogia...

Fancy Blockquotes

Basic un-classed blockquotes need not be complicated. But we should also consider blockquites prefixed with a class:

{.quote-pull}
> Some stuff here to go in the quote

Possible considerations:

  • quote-large - Very large text, for short quotes.
  • quote-small - Normal sized text, for very long quotes.
  • quote-pull - Centered pullquote.

Sizing with Clamp that doesn't affect the `.essay` container.

We currently scale the text size on the essay container using clamp(). This causes all of the elements in the essay to scale accordingly so long as their sizing is calculated in ems.

The issue is that, having increased the base font-size inside .essay, 1rem is no longer representative of the base font size so we can't use terms anywhere in the essay.

It would possibly be better to simply change the value of 1rem using clamp(), though this would affect the whole site not just articles.

The other option is to use clamp individually on each type of element to scale only the things that I actually want to scale, and leave the rest at the same size for all viewports.

But perhaps none of this really matters too much. KISS.

Dark Mode

This should probably include:

  • Detecting UAs preferred mode.
  • Allowing users to switch modes with a button or something, and saving the mode in session storage.
  • Swapping our various colours.
  • Reducing the colour of images and videos by applying a filter like filter: grayscale(30%).
  • Increasing the contrast and stroke weight of some type.

See more tips here:

Add Typeset.js

Mutates the HTML at build-time to add various things.

I don't need all the functions: many of them are covered by my existing CSS.

Things which might be useful:

  • Hyphenation using soft hyphen characters instead of default browser hyphenation.
  • Optical margin nudging for first letters (not good for accessibility - see davidmerfield/Typeset#38
  • Hanging punctuation margin-nudging.
  • Wrapping small caps candidates in a suitable class, to save adding abbr tags manually.
  • Some elements of punctuation substitution.

https://github.com/zacwasielewski/jekyll-typeset

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.