Skip to content

Commit

Permalink
Image import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihalyov committed Jan 23, 2022
1 parent 82dc2ed commit c86bb6c
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 20 deletions.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Pure Start

[Demo](https://nmihalyov.tk/pure-start)

**Pure Start** is a boilerplate that allows you to start working on a new project fast and easy. It provides you with a clean and flexible environment to create static applications and can be extended to create something more complex.

## Features
Expand Down Expand Up @@ -62,4 +64,25 @@ At the root there a some config files and script for creating components via CLI

`scss` for global styles (don't write component specific styles here).

`index.js` is entry point for youe JS/TS files.
`index.js` is entry point for youe JS/TS files.

## Importing images
### Pug
To import image in pug files use **require**. E.g.:

`img(src=require("@/assets/images/static/logo.png"), alt="Logo")`

### Scss
To use images in scss you can simply do it as you did before. E.g.:

`background-image: url('@/assets/images/icons/github-white.svg')`

## Feedback

E-mail: [nikita.mihalyov@gmail.com](mailto:nikita.mihalyov@gmail.com)

Teleegram: [@nmihalyov](http://t.me/nmihalyov)

Website: [nmihalyov.tk](https://nmihalyov.tk)

[Write issue](https://github.com/nmihalyov/pure-start/issues/new)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pure-start",
"version": "2.0.0",
"version": "2.0.1",
"description": "Start your project with 'Pure Start' easily then ever!",
"private": "true",
"scripts": {
Expand Down
Binary file added src/assets/images/favicons/144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/favicons/152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/favicons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/favicons/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/favicons/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/static/logo.png
Binary file not shown.
5 changes: 2 additions & 3 deletions src/pug/pages/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ include /components/_ui/radio/radio
include /components/_ui/popup/popup

block variables
- const title = 'Document'
- const title = 'Pure Start'
- const description = 'Page description'

block content
section.container
.wrapper
h1(style="margin: 35px 0") Pure Start
sup(style="font-size: 12px") v2.0.0
//- img(src=require("@/assets/images/static/logo.png"), alt="")
sup(style="font-size: 12px") v2.0.1
h3(style="margin-bottom: 25px") Components examples

h4(style="margin-bottom: 10px") 1. Buttons
Expand Down
14 changes: 7 additions & 7 deletions src/pug/utils/links.pug
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//- favicons
link(rel="shortcut icon", href="@/assets/images/favicons/64x64.png", type="image/png")
link(rel="icon", href="@/assets/images/favicons/152x152.png", type="image/png", sizes="152x152")
link(rel="icon", href="@/assets/images/favicons/256x256.png", type="image/png", sizes="256x256")
link(rel="icon", href="@/assets/images/favicons/512x512.png", type="image/png", sizes="512x512")
link(rel="apple-touch-icon", href="@/assets/images/favicons/152x152.png", sizes="152x152")
link(rel="apple-touch-icon", href="@/assets/images/favicons/256x256.png", sizes="256x256")
link(rel="apple-touch-icon", href="@/assets/images/favicons/512x512.png", sizes="512x512")
link(rel="shortcut icon", href=require("@/assets/images/favicons/64x64.png"), type="image/png")
link(rel="icon", href=require("@/assets/images/favicons/152x152.png"), type="image/png", sizes="152x152")
link(rel="icon", href=require("@/assets/images/favicons/256x256.png"), type="image/png", sizes="256x256")
link(rel="icon", href=require("@/assets/images/favicons/512x512.png"), type="image/png", sizes="512x512")
link(rel="apple-touch-icon", href=require("@/assets/images/favicons/152x152.png"), sizes="152x152")
link(rel="apple-touch-icon", href=require("@/assets/images/favicons/256x256.png"), sizes="256x256")
link(rel="apple-touch-icon", href=require("@/assets/images/favicons/512x512.png"), sizes="512x512")
8 changes: 4 additions & 4 deletions src/pug/utils/metas.pug
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ meta(name="description", content="Page description")
meta(name="keywords", content="page, keywords")

//- web application theme color
meta(name="theme-color", content="#000000")
meta(name="theme-color", content="#202020")

//- copyriht
meta(name="copyright", content="Author")

//- apple web application tags
meta(name="apple-mobile-web-app-capable", content="yes")
meta(name="apple-mobile-web-app-status-bar-style", content="#000000")
meta(name="apple-mobile-web-app-status-bar-style", content="#202020")
meta(name="apple-mobile-web-app-title", content="Application Name")

//- windows web application tags
meta(name="msapplication-TileImage", content="@/img/favicons/144x144.png")
meta(name="msapplication-TileColor", content="#000000")
meta(name="msapplication-TileImage", content=require("@/assets/images/favicons/144x144.png"))
meta(name="msapplication-TileColor", content="#202020")

//- disable phone number link
meta(name="format-detection", content="telephone=no")
Expand Down
5 changes: 3 additions & 2 deletions src/scss/utils/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
&:focus-visible:not([disabled]):not([readonly]) {
outline: 2px solid $lightBlue;
outline-offset: 0;
transition: outline 0s;
}
}

Expand Down Expand Up @@ -74,8 +75,8 @@ a {

.container {
.wrapper {
max-width: 320px;
padding: 0 10px;
max-width: 440px;
padding: 0 15px;
}
}
}
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Pure Start © 2017 – 2021, Nikita Mihalyov <nikita.mihalyov@gmail.com>
* Pure Start © 2017 – 2022, Nikita Mihalyov <nikita.mihalyov@gmail.com>
* ISC Licensed
* v2.0.0
* v2.0.1
*/

const path = require('path');
Expand Down

0 comments on commit c86bb6c

Please sign in to comment.