Skip to content

shakibamoshiri/badge-for-stackoverflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

badge-for-stackoverflow

Hi

During developing my app (= badge-for-git) I realized that I can use these badges (= SVG files) on my stack-overflow profile
So here is a guide for you that you can use it as well.

What you need:

  1. an account on github.com (for storing the SVG files)
  2. create a repository (short name is preferable, mine is s)
  3. use badge-for-git and create what you want
  4. follow the instructions I putted there (= on badge-for-git, step 1 through 6)
  5. then follow the below steps

step.1 click on your own SVG-file

step.2 click on "Raw" button

step.3 see the source-code and notice to the "url"

It consists of:

  1. https://
  2. raw.
  3. github, user, content and .com. altogether: githubusercontent.com
  4. your user-name, mine is k-five
  5. your repository name, mine is s
  6. branch, mine is master
  7. directory name, mine is a
  8. name of the SVG file, mine is bpy-bfg.svg

step.4 add suffix to the url

  1. suffix: ?sanitize=true
  2. press Enter
  3. if want to see a clean source-code, right-click add see: "view-source-page" (optional)
  4. copy the URL

step.5

go on your stack-overflow account on anywhere you like use an img HTML tag or use stack-overflow shortcut: ![file-name](file-URL)

Example 1. img tag

for me: <img src="https://raw.githubusercontent.com/k-five/s/master/a/pby-bfg.svg?sanitize=true" />

Example 2. shortcut

for me: ![powered-by-badge-for-git](https://raw.githubusercontent.com/k-five/s/master/a/pby-bfg.svg?sanitize=true)

Tip. add link to it

by default if you add with an <img> tag or even ![]() shortcut you cannot click on and the SVG file refers to nowhere
So if you want to add a link to it:

for me:

<a href="https://github.com/k-five/badge-for-git">
  <img src="https://raw.githubusercontent.com/k-five/s/master/a/pby-bfg.svg?sanitize=true" />
</a>

with shortcut:

[![](https://raw.githubusercontent.com/k-five/s/master/a/pby-bfg.svg?sanitize=true)]
(https://github.com/k-five/badge-for-git)

result

My Profile on Stack-Overflow

if

  1. you have any questions, ideas, problems, etc raise an issue on badge-for-git
  2. you are curious about what sanitize does see w3schools.com

troubleshooting

  • if you did not get the correct result, make user the URL is valid and correct, the ?sanitize=true is vital!
  • if you changed a file (= SVG) or wanted to replace it, it is better to clean you cache otherwise may do do not get the result

Releases

No releases published

Packages

No packages published