Skip to content

Instantly share code, notes, and snippets.

View michaelsynan's full-sized avatar

Michael Synan michaelsynan

View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active July 18, 2024 05:22
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@tduarte
tduarte / publish-ghpages.md
Last active May 18, 2024 13:52
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active July 22, 2024 14:45
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@michaelsynan
michaelsynan / nuxt_gh-pages.md
Last active April 15, 2023 00:41
Deploy static Nuxt site to Github Pages with a custom domain

Easily Deploy a Static Nuxt Site on GitHub Pages w/ Custom Domain

Deploy to GitHub Pages and generate .nojekyll and CNAME files to output directory. Create & push to gh-pages subtree.

touch ./gitignore 
sed -i '/.output/d' .gitignore # remove .output from .gitignore
npm run generate
touch .output/public/.nojekyll    
echo "yourdomain.com" > .output/public/CNAME # only necessary for custom domain