<json-resume>
is a web component (using LitElement) which presents resume content stored in JSON Resume format. The HTML structure uses the components from jsonresume-theme-microdata to generate HTML which includes structured data as microdata in HTML attributes.
<json-resume>
extends <json-resume-ui>
(included in the NPM release and this repo), which can be used in server-side rendering situations to generate a declarative shadow DOM containing the resume HTML and styles.
Check out the storybook for jsonresume-component
to play with both components.
npm i jsonresume-component
import { JsonResume } from 'jsonresume-component';
<JsonResume gist_id="9e7a7ceb9425336c6aa08d58afb63b8d"></JsonResume>
You can generate the HTML on the server using the <json-resume-ui>
component.
import { JsonResumeUI } from 'jsonresume-component/ui';
// your resume data
import resumejson from '../local/path/to/resume.json'
// you can use your own stylesheet instead of the bundled one
import styles from 'jsonresume-component/style.css?inline'
<JsonResumeUI resumejson={resumejson} stylesheet={styles}></JsonResumeUI>
The web component is lightly-bundled in that it puts all non-lit
external files in a single .js file, which is located at ./dist/json-resume.js
in the NPM package.
<json-resume>
uses lit
and @lit/task
which must be imported into your HTML file. You can include dependencies with an importmap like this:
<script type="importmap">
{
"imports": {
"lit": "https://esm.run/lit",
"@lit/task": "https://esm.run/@lit/task"
}
}
</script>
unpkg
points directly to the lightly-bundled web component file, which does not include lit
.
<script type="module">
import 'https://unpkg.com/jsonresume-component'
</script>
<json-resume gist_id="54682f0aa17453d46cdc74bdef3172a3"></json-resume>
<json-resume json_url="https://gist.githubusercontent.com/scottnath/54682f0aa17453d46cdc74bdef3172a3/raw/resume.json"></json-resume>
The JSON structure follows an extension of the JSON Resume schema with added schema structure for microdata itemtype
on some content types, basics.pronouns
, and meta.themeOptions
which allows changing the content of the resume section titles, colors, and other theme opts. See the jsonresume-theme-microdata README for details on this adjusted structure.
Name | Privacy | Type | Default | Description | Inherited From |
---|---|---|---|---|---|
label |
public | string |
The aria-label for the `div` containing the resume. Defaults to `${basics.name}'s resume` | ||
resumejson |
public | object |
Property accepts a JSON Resume object | ||
stylesheet |
public | string |
Accepts a string containing styles **WARNING** Completely deletes and overrides internal component styles |
Name | Default | Description |
---|---|---|
--color-background-light |
Background color, light theme | |
--color-dimmed-light |
Dimmed background color, light theme | |
--color-primary-light |
Primary color, light theme | |
--color-secondary-light |
Secondary color, light theme | |
--color-link-light |
Link color, light theme | |
--color-background-dark |
Background color, dark theme | |
--color-dimmed-dark |
Dimmed background color, dark theme | |
--color-primary-dark |
Primary color, dark theme | |
--color-secondary-dark |
Secondary color, dark theme | |
--color-link-dark |
Link color, dark theme | |
--font-size |
Component font size, basis for many `em`-based styles | |
--font-family |
Component font family |
Name | Description |
---|---|
jsonresume |
resume container |
resume |
resume main article |
basics |
style the `basics` section |
name |
person's name, h1 |
label |
person's title/label, h2 |
image |
person's image |
summary |
person's summary |
contact |
contacts/locations list within basics |
profiles |
profiles list within basics |
section-title |
styles the `h3` title of all sections |
work |
style the `work` section |
volunteer |
style the `volunteer` section |
education |
style the `education` section |
awards |
style the `awards` section |
certificates |
style the `certificates` section |
publications |
style the `publications` section |
skills |
style the `skills` section |
languages |
style the `languages` section |
interests |
style the `interests` section |
references |
style the `references` section |
projects |
style the `projects` section |
meta |
style the `meta` section |
Name | Description |
---|---|
basics |
Replace the entire `basics` HTML section |
work |
Replace the entire `work` HTML section |
volunteer |
Replace the entire `volunteer` HTML section |
education |
Replace the entire `education` HTML section |
awards |
Replace the entire `awards` HTML section |
certificates |
Replace the entire `certificates` HTML section |
publications |
Replace the entire `publications` HTML section |
skills |
Replace the entire `skills` HTML section |
languages |
Replace the entire `languages` HTML section |
interests |
Replace the entire `interests` HTML section |
references |
Replace the entire `references` HTML section |
projects |
Replace the entire `projects` HTML section |
meta |
Replace the entire `meta` HTML section |
Kind | Name | Declaration | Module | Package |
---|---|---|---|---|
js |
JsonResumeUI |
JsonResumeUI | src/ui.js | |
custom-element-definition |
json-resume-ui |
JsonResumeUI | src/ui.js |
Name | Privacy | Type | Default | Description | Inherited From |
---|---|---|---|---|---|
gist_id |
public | string |
GitHub gist ID. When present, calls the GitHub rest API to fetch a resume.json gist's content. Checked first, if gist is present and has a resume.json, `json_url` and `local_file` will be ignored. | ||
json_url |
public | string |
URL to a JSON file. When present, used to fetch a resume.json file from the URL. Checked second or if gist_id does not have a resume.json, `local_file` will be ignored. | ||
preordered |
public | boolean |
When true, sections of resume (basic, work, etc) will be injected according to their order in resume.json | ||
label |
public | string |
The aria-label for the `div` containing the resume. Defaults to `${basics.name}'s resume` | JsonResumeUI | |
resumejson |
public | object |
Property accepts a JSON Resume object | JsonResumeUI | |
stylesheet |
public | string |
Accepts a string containing styles **WARNING** Completely deletes and overrides internal component styles | JsonResumeUI |
Name | Default | Description |
---|---|---|
--color-background-light |
Background color, light theme | |
--color-dimmed-light |
Dimmed background color, light theme | |
--color-primary-light |
Primary color, light theme | |
--color-secondary-light |
Secondary color, light theme | |
--color-link-light |
Link color, light theme | |
--color-background-dark |
Background color, dark theme | |
--color-dimmed-dark |
Dimmed background color, dark theme | |
--color-primary-dark |
Primary color, dark theme | |
--color-secondary-dark |
Secondary color, dark theme | |
--color-link-dark |
Link color, dark theme | |
--font-size |
Component font size, basis for many `em`-based styles | |
--font-family |
Component font family |
Name | Description |
---|---|
jsonresume |
resume container |
resume |
resume main article |
basics |
style the `basics` section |
name |
person's name, h1 |
label |
person's title/label, h2 |
image |
person's image |
summary |
person's summary |
contact |
contacts/locations list within basics |
profiles |
profiles list within basics |
section-title |
styles the `h3` title of all sections |
work |
style the `work` section |
volunteer |
style the `volunteer` section |
education |
style the `education` section |
awards |
style the `awards` section |
certificates |
style the `certificates` section |
publications |
style the `publications` section |
skills |
style the `skills` section |
languages |
style the `languages` section |
interests |
style the `interests` section |
references |
style the `references` section |
projects |
style the `projects` section |
meta |
style the `meta` section |
Name | Description |
---|---|
basics |
Replace the entire `basics` HTML section |
work |
Replace the entire `work` HTML section |
volunteer |
Replace the entire `volunteer` HTML section |
education |
Replace the entire `education` HTML section |
awards |
Replace the entire `awards` HTML section |
certificates |
Replace the entire `certificates` HTML section |
publications |
Replace the entire `publications` HTML section |
skills |
Replace the entire `skills` HTML section |
languages |
Replace the entire `languages` HTML section |
interests |
Replace the entire `interests` HTML section |
references |
Replace the entire `references` HTML section |
projects |
Replace the entire `projects` HTML section |
meta |
Replace the entire `meta` HTML section |
Kind | Name | Declaration | Module | Package |
---|---|---|---|---|
js |
JsonResume |
JsonResume | src/index.js | |
custom-element-definition |
json-resume |
JsonResume | src/index.js |