Skip to content

Commit

Permalink
fix(props): missed pre block styles
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyurec committed Oct 3, 2022
1 parent 30cadbd commit bf00c2c
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 21 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">"Awesome Links" plugin for Logseq</h1>
<p align="center">
<a href="https://github.com/yoyurec/logseq-awesome-links">
<img src="icon.png" alt="logo" width="128" height="128" />
<img src="https://github.com/yoyurec/logseq-awesome-links/raw/main/icon.png" alt="logo" width="128" height="128" />
</a>
</p>

Expand All @@ -16,7 +16,7 @@
## Install
From Logseq store - `Plugins -> Marketplace`.

![](./screenshots/market.png)
![](https://github.com/yoyurec/logseq-awesome-links/raw/main/screenshots/market.png)

## Recommended plugins/themes
* 🐱‍👤 [Awesome Styler](https://github.com/yoyurec/logseq-awesome-styler) theme
Expand All @@ -28,7 +28,7 @@ From Logseq store - `Plugins -> Marketplace`.

### ⭐ Auto favicons for external links

<img src="screenshots/favicons.png" width="640">
<img src="https://github.com/yoyurec/logseq-awesome-links/raw/main/screenshots/favicons.png" width="640">

### ✨ Page icons

Expand All @@ -40,7 +40,7 @@ For ex.:
* set in plugin settings "Inherit icon from..." `page-type`
* ...and all pages with `page-type:: [[Projects]]` will have inherited "Projects" page icon!

![Page icons](screenshots/page-icons.png)
![](https://github.com/yoyurec/logseq-awesome-links/raw/main/screenshots/page-icons.png)

### ✨ Custom page icons

Expand All @@ -53,15 +53,15 @@ Native Logseq props `icon::` extended with Nerd icons font:

Banners & Tabs plugin support included 😎

![Nerd icons](screenshots/nerd-icons.png)
![](https://github.com/yoyurec/logseq-awesome-links/raw/main/screenshots/nerd-icons.png)

![Nerd font](screenshots/nerd.png)
![](https://github.com/yoyurec/logseq-awesome-links/raw/main/screenshots/nerd.png)

### ✨ Journal icon

Can be customized in settings.

![Journal icon](screenshots/journal-icon.png)
![](https://github.com/yoyurec/logseq-awesome-links/raw/main/screenshots/journal-icon.png)

## What is Logseq?
Logseq is a privacy-first, open-source knowledge base. Visit https://logseq.com for more information.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "dist/index.html",
"scripts": {
"dev": "vite",
"build": "tsc && vite build && cp -f -r src/css dist/assets",
"build": "tsc && vite build",
"preinstall": "npx only-allow pnpm",
"semantic-release": "semantic-release"
},
Expand Down
File renamed without changes.
22 changes: 19 additions & 3 deletions src/css/awesomeLinks.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
font-family: "Fira Code Nerd Font";
font-style: normal;
font-weight: 400;
src: url('fonts/fira-code-nerd-regular.ttf') format('truetype');
src: url('/fonts/fira-code-nerd-regular.ttf') format('truetype');
}

/*
Expand Down Expand Up @@ -87,7 +87,23 @@ body:not(.is-banner-active).is-awesomeLinks-journal .is-journals h1.title::befor


/*
>>> BEGIN: Settigns
>>> BEGIN: Props
*/
.pre-block > .flex-row .editor-wrapper textarea,
.page-properties,
.block-properties {
font-family: var(--icon-font);
font-size: 0.9rem;
letter-spacing: -1px;
word-spacing: -1px;
}
/*
<<<< END: Props
*/


/*
>>> BEGIN: Settings
*/
.panel-wrap[data-id="logseq-awesome-links"] .desc-item[data-key="featureInheritPageIcons"] {
margin-left: 46px;
Expand All @@ -98,7 +114,7 @@ body:not(.is-banner-active).is-awesomeLinks-journal .is-journals h1.title::befor


/* promo */
.is-solext .desc-item[data-key="promoSolext"] {
.is-awesomeStyler-loaded .desc-item[data-key="promoSolext"] {
display: none;
}

Expand Down
2 changes: 1 addition & 1 deletion src/css/tabsPlugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
font-family: "Fira Code Nerd Font";
font-style: normal;
font-weight: 400;
src: url('lsp://logseq.io/logseq-awesome-links/dist/assets/css/fonts/fira-code-nerd-regular.ttf') format('truetype');
src: url('lsp://logseq.io/logseq-awesome-links/dist/fonts/fira-code-nerd-regular.ttf') format('truetype');
}

.logseq-tab .text-xs {
Expand Down
10 changes: 6 additions & 4 deletions src/js/awesomeLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import '@logseq/libs';
import { SettingSchemaDesc, LSPluginBaseInfo } from '@logseq/libs/dist/LSPlugin.user';
import { logseq as PL } from '../../package.json';

import tabsPluginStyles from '../css/tabsPlugin.css';
import '../css/awesomeLinks.css';

import tabsPluginStyles from '../css/tabsPlugin.css?inline';

const pluginID = PL.id;

Expand Down Expand Up @@ -181,7 +183,7 @@ const setPageIcons = async (linkList: NodeListOf<HTMLAnchorElement>) => {
if (oldPageIcon) {
oldPageIcon.remove();
}
let pageTitle = linkItem.getAttribute('data-ref');
const pageTitle = linkItem.getAttribute('data-ref');
if (!pageTitle) {
continue;
}
Expand Down Expand Up @@ -416,7 +418,7 @@ const onPluginUnloadCallback = () => {
const registerPlugin = async () => {
setTimeout(() => {
if (doc.head) {
doc.head.insertAdjacentHTML('beforeend', `<link rel="stylesheet" id="css-awesomeLinks" href="lsp://logseq.io/${pluginID}/dist/assets/css/awesomeLinks.css">`)
doc.head.insertAdjacentHTML('beforeend', `<link rel="stylesheet" id="css-awesomeLinks" href="lsp://logseq.io/${pluginID}/dist/assets/awesomeLinks.css">`)
}
const tabsPluginIframe = doc.getElementById('logseq-tabs_iframe') as HTMLIFrameElement;
if (tabsPluginIframe) {
Expand Down Expand Up @@ -455,7 +457,7 @@ const main = async () => {

initLinksObserver();

// First thme run
// First run
runStuff();

// Later listeners
Expand Down
19 changes: 14 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { defineConfig } from "vite";
import logseqDevPlugin from "vite-plugin-logseq";
import { defineConfig } from 'vite';
import logseqDevPlugin from 'vite-plugin-logseq';

const name = 'awesomeLinks';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [logseqDevPlugin()],
// Makes HMR available for development
build: {
sourcemap: true,
target: "esnext",
minify: "esbuild",
},
target: 'esnext',
minify: 'esbuild',
rollupOptions: {
output: {
entryFileNames: `assets/${name}.js`,
chunkFileNames: `assets/chunks/${name}.js`,
assetFileNames: `assets/${name}.[ext]`,
}
}
}
});

0 comments on commit bf00c2c

Please sign in to comment.