npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuepress-theme-single-page-sections

v1.1.4

Published

A VuePress theme that extends the default theme by sections to create single page layouts with several sections combined on one page

Downloads

4

Readme

Single Page VuePress Theme

This these extends the VuePress default theme @vuepress/theme-default for a layout for single page sites that contain several sections, each covering at least one view height. I think this is easier described with a picture:

Desktop version:

vuepress-theme-single-page-sections on desktop

Mobile version:

vuepress-theme-single-page-sections on mobile vuepress-theme-single-page-sections on mobile with menu open

I developed this theme as the basis for my personal homepage. So it can well be used to put your resume online.

It also defines a couple of social icons that you can use to link to your online profiles.

Features

  • Vue components for social media links as icons, with icons taken from font-awesome
  • Predefined components for: Facebook, Twitter, Telegram, LinkedIn, XING, Keybase, ORCID, GitHub, e.g.
    <Social-LinkedIn id="petertandler" />
    <Social-GitHub id="ptandler" />
  • Vue components for contact information (email, phone) that generate obfuscated text and links to provide some challenges for harvesting bots and to avoid spam:
    <Contact-Phone title="Phone" country="49" city="1234" number="56789" />
    <br/>
    <Contact-Email name="someone" domain="example.com" /> <!-- webmaster is the default name if not passed -->
    • non-digits from phone numbers are stripped to create the tel: URL.
  • For public numbers you can choose whether or not to obfuscate emails and phone numers by passing the obfuscate prop (which defaults to true):
    <Contact-Phone title="Phone" country="49" city="1234" number="56789" obfuscate="false" />
  • Privacy-friendly way to pass sensitive contact information (e.g. mobile number, private email, messanger name) via URL in (e.g.) email footer - that will be included in the homepage exactly as the other icons. Some information can be passed directly in VuePress, see below.

Combine personal and public contact information on your homepage

Do you know this situation? There are contact information such as your private email, mobile number, or instant messengers that you don't want to be available for everyone.

  • But on the other side, it would be nice if you could send your complete contact information to selected contacts you trust in a way that is nicely displayed.

Facing this issue, I came up with the idea that I could amend my homepage such that I can create a personal link that includes the contact information I would like to make available to some contacts. And for those, additional information should be displayed. Or even better, I could create different links for different groups of contacts, such as my friends, business contacts and so on.

However, I didn't want to have the personal contact information somewhere hidden in the HTML or JavaScript to really protect privacy here.

So I came up with the idea that I could pass the personal contact information to the homepage using URL parameters. The vue theme then, will check for contact information passed in the URL, include it and stores it in local storage to be available later on for this person, e.g. when navigating. The theme treats information found in the URL, the local storage, or passed from the markdown files to the theme's Vue component <Contact-Details> in exactly the same way.

On the other hand, contact information provided directly to the Vue component is obfuscated to provide some challenges for harvesting bots and to avoid spam.

Put contact information that should be available to the public directly in your markdown:

<Contact-Details
  :email_as_icon="false" 
  :phone_as_icon="false"
  :mobile_as_icon="false"
  linkedin="myLinkedInId"
  xing="myXINGId"
  github="myGitHubId"
  keybase="myKeybaseId"
  twitter="myTwitterId"
  researchgate="myResearchGateId"
  />

Then, for your friends and business contacts you can pass additional information in the URL (e.g. in you email footer): For example if the example homepage here is called like: https://ptandler.github.io/vuepress-theme-single-page-sections/[email protected]&skype=mySkypeId then the email and skype id is also included in the list of contact details.

To pass phone numbers, the pattern for phone numbers is: +country-city-number-ext where country and city are optional and ext has no special treatment but will be part of the number. This pattern allows consistent formatting of phone numbers. Make sure that the "+" is escaped properly as %2B (some browsers might convert it into a space instead) and better to escape spaces as %20.

You can pass a phone and a mobile number.

And you can define a custom title for phone and mobile: phone.title.

Example https://ptandler.github.io/vuepress-theme-single-page-sections/?phone=%2B49-1234-56789-0&phone.title=Telefon

See Contact/Details.vue for the list of supported parameters (in const attributes).

Example

In the example directory, there is a simple sample project.

You can see this live at https://ptandler.github.io/vuepress-theme-single-page-sections/

Setup

This theme uses VuePress v1.

Install the theme:

yarn install -D vuepress-theme-single-page-sections

Usage

In your .vuepress/config.js include theme: "single-page-sections". And I recommend the following themeConfig. The themeConfig comes from the default theme.

module.exports = {
  theme: "single-page-sections",
  themeConfig: {
    sidebar: "auto",
    search: false,
    smoothScroll: true,
    social: { monochrome_icons: false },
    editLinks: false,
    nextLinks: false,
    prevLinks: false,
  },
}

And on the pages that should contain several sections use the following frontmatter:

---
title: Page Title...
pageClass: sections-layout
sidebarImage: /small-image.jpg
---

<PageSection id="welcome" title="First Section">

Some content...

</PageSection>

---

::: section Second Section

Some content... this time using the markdown "custom container" syntax.

:::

The sidebarImage is optional. If defined, this image is included in the sidebar above the navigation links. In the mobil version, it is included in the navbar instead, as the sidebar is hidden then.

Customization

The colors used are defined in styles\palette.styl and can be customized to fit your personal preferences.

Implementation

This theme overwrites two components from the default theme: