Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev patches #450

Merged
merged 18 commits into from
Oct 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ updates:
labels:
- dependencies
versioning-strategy: increase
rebase-strategy: disabled
Binary file added .github/preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": [
"stylelint-config-twbs-bootstrap/scss"
]
],
"rules": {
"scss/selector-no-union-class-name": true
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## 1,100+ icons

[![Bootstrap Icons full set](https://user-images.githubusercontent.com/98681/91365119-402cdc00-e7b5-11ea-9a2c-e1a03aed21c3.png)](https://icons.getbootstrap.com)
[![Bootstrap Icons full set](https://github.com/twbs/icons/blob/main-dev/.github/preview.png)](https://icons.getbootstrap.com)

[Also available in Figma.](https://www.figma.com/file/9YmlUAwhMv99G4yP4yN7Jy/Bootstrap-Icons-v1.0.0?node-id=0%3A1)

Expand Down Expand Up @@ -81,7 +81,7 @@ Use `npm run icons` to run the script, run `npm run pages` to build permalink pa

## Publishing

Documentation is published automatically when a new Git tag is published. See our GitHub Actions and `package.json` for more information.
Documentation is published automatically when a new Git tag is published. See our [GitHub Actions](https://github.com/twbs/icons/tree/main/.github/workflows) and [`package.json`](https://github.com/twbs/icons/blob/main/package.json) for more information.

## License

Expand Down
10 changes: 5 additions & 5 deletions build/build-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

const fs = require('fs')
const path = require('path')
const chalk = require('chalk')

const iconsDir = path.join(__dirname, '../icons/')
const pagesDir = path.join(__dirname, '../docs/content/icons/')
Expand All @@ -18,8 +19,7 @@ function capitalizeFirstLetter(string) {

for (const file of files) {
const iconBasename = path.basename(file, path.extname(file))
const iconTitleCap = capitalizeFirstLetter(iconBasename)
const iconTitle = iconTitleCap.split('-').join(' ')
const iconTitle = capitalizeFirstLetter(iconBasename).split('-').join(' ')
const pageName = path.join(pagesDir, `${iconBasename}.md`)

const pageTemplate = `---
Expand All @@ -36,14 +36,14 @@ tags:
throw err
}

console.log(`${iconBasename} successfully created`)
console.log(chalk.green(`${iconBasename} successfully created`))
})
} else {
console.log(`${iconBasename}: Permalink already exists`)
console.log(chalk.cyan(`${iconBasename}: Permalink already exists`))
}
})
}
} catch (error) {
console.error('Error', error)
console.error(chalk.cyan(`Error: ${error}`))
}
})()
12 changes: 7 additions & 5 deletions docs/layouts/icons/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ <h2>Examples</h2>
}
})

clipboard.on('success', function (e) {
e.clearSelection()
e.trigger.textContent = 'Copied!'
clipboard.on('success', function (event) {
event.clearSelection()
event.trigger.textContent = 'Copied!'
setTimeout(function () {
e.trigger.textContent = 'Copy'
event.trigger.textContent = 'Copy'
}, 2000);
})

Expand All @@ -109,7 +109,9 @@ <h2>Examples</h2>
var fallbackMsg = 'Press ' + modifierKey + 'C to copy'
var errorElement = document.getElementById('copy-error-callout')

if (!errorElement) return
if (!errorElement) {
return
}

errorElement.classList.remove('d-none')
errorElement.insertAdjacentHTML('afterbegin', fallbackMsg)
Expand Down
6 changes: 2 additions & 4 deletions docs/layouts/partials/icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2 id="icons" class="mb-0">Icons</h2>
</form>
</div>
<ul class="row row-cols-3 row-cols-sm-4 row-cols-lg-6 row-cols-xl-8 list-unstyled list">
{{- $dirName := "icons" -}}
{{ $dirName := "icons" -}}

{{- range (readDir $dirName) -}}
{{- $filenameWithExt := split .Name "." -}}
Expand All @@ -19,9 +19,7 @@ <h2 id="icons" class="mb-0">Icons</h2>
<use xlink:href="bootstrap-icons.svg#{{ $filename }}"/>
</svg>
</div>
<div class="name text-muted text-decoration-none text-center pt-1">
{{ $filename }}
</div>
<div class="name text-muted text-decoration-none text-center pt-1">{{ $filename }}</div>
</a>
</li>
{{ end -}}
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar px-0">
<div class="container flex-wrap flex-md-nowrap py-0 px-3">
<a class="navbar-brand p-0 mr-0 mr-md-2" href="{{ .Site.Params.main }}/" aria-label="Bootstrap">
{{ partial "icons/bootstrap-white-fill.svg" (dict "class" "d-block" "height" "32") }}
{{ partial "icons/bootstrap-white-fill.svg" (dict "class" "d-block" "width" "40" "height" "32") }}
</a>

<div class="navbar-nav-scroll order-3 order-md-0 d-flex justify-content-center justify-content-md-start mt-1 mt-md-0">
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/partials/social.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:title" content="{{ .Title | default .Site.Title | markdownify }}">
<meta property="og:description" content="{{ .Page.Params.description | default .Site.Params.description | markdownify }}">
<meta property="og:type" content="website">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
<meta property="og:image" content="{{ .Site.Params.social_image_path | absURL }}">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1000">
Expand Down
3 changes: 1 addition & 2 deletions docs/static/assets/css/bootstrap.min.css

Large diffs are not rendered by default.