https://github.com/aamnah/sublime-text-snippets
Snippets for Sublime Text
https://github.com/aamnah/sublime-text-snippets
Last synced: 5 months ago
JSON representation
Snippets for Sublime Text
- Host: GitHub
- URL: https://github.com/aamnah/sublime-text-snippets
- Owner: aamnah
- Created: 2024-07-20T22:55:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-31T21:02:54.000Z (over 1 year ago)
- Last Synced: 2025-07-24T09:17:15.390Z (12 months ago)
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snippets for Sublime Text
Tested with Sublime Text 4
## slug.sublime-snippet
trigger: `slug`
Converts filename to a slug that can be used inside a URL. Replace spaces with dashes, convert characters to lowercase and remove file extension
```
ai-image-generation.md -> ai-image-generation
Online card payments.md -> online-card-payments
some Random FIle NAME with blah.txt -> some-random-file-name-with-blah
```
## yaml-metadata.sublime-snippet
trigger: `meta`
Generates a YAML frontmatter block. Using this for markdown notes for Hugo. Not very effective since date is not available inside snippets. The only variable that is somewhat useful is `{$TM_FILENAME}` which is being used to generate a value for _slug_ and placeholder as a value for _title_
```yaml
---
title: Based On Filename
date:
uuid:
slug: based-on-filename
draft: true
description:
tags:
---
```
Title:
- replace `-` and `_` with a space
- uppercase the first character of the word
- remove file extension
Slug:
- replace spaces with `-`
- lowercase all characters
- remove file extension